#include "ByteArrAndBasicTypeConvertorTest.h"
#include "ByteArrAndBasicTypeConvertor.h"
#include<iostream>

using namespace std;
using namespace com::example::testone::common;


com::example::testone::common::ByteArrAndBasicTypeConvertorTest::ByteArrAndBasicTypeConvertorTest()
{
    //ctor
}

com::example::testone::common::ByteArrAndBasicTypeConvertorTest::~ByteArrAndBasicTypeConvertorTest()
{
    //dtor
}

void com::example::testone::common::ByteArrAndBasicTypeConvertorTest::test(){
    this->test1();
}


void com::example::testone::common::ByteArrAndBasicTypeConvertorTest::test1(){
    ByteArrAndBasicTypeConvertor convertor;
    char buf[4];
    convertor.converIntToByteArr(buf, 4, 3895);
    unsigned char x;
    for(int i = 0; i < 4; i++){
        x = buf[i];
        printf("%2x, ", x);
    }
    printf("\n");
    cout << "======================" << endl;

    int resultInt = convertor.convertByteArrToInt(buf, 4);
    cout << resultInt << endl;
}
